<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
<title></title>
<link href="../css/common.css" rel="stylesheet" type="text/css"/>
<link href="../css/photo.css" rel="stylesheet" type="text/css"/>
<link href="css/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css"/>
<style>
</style>
</head>
<body>
<div id="page_ctn">
	<div id="content_ctn">
		<div class="album_title"><a class="left" href="album.html">返回</a><h1></h1></div>
		<div id="photo_list_ctn" class="img_list">
			<ul class="clearfix">
			</ul>
		</div>
		<div id="pagination_ctn"></div>
	</div>
</div>
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.5.min.js"></script>
<script type="text/javascript" src="js/YY_dialog.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript"><!--
$(window).scroll(set_window).resize(set_window);
var album_id=Request.query("album_id");
if (album_id==null)
	location.href='album.html';
$.get('ajax_response.php',{type:'login'},function(data){
	if (data.result){
		logined=true;
	}
	load_func();
},'json');
var load_func=function(){
//	var loading=new show_loading();
//	loading.stop();
	set_window();
	if (!logined)
		login();
	else{
		$('#login_ctn').hide();
		$('#content_ctn').show();
		$.get('ajax_response.php',{type:'get_photo',album_id:album_id},function(data){
			var str='';
			var img=new Array();
			$('.album_title h1').html(data.album_name);
			//$('title').html(data.album_name);
			if (data.data.length>0){
				$(data.data).each(function(n,v){
					var img_url='dl.php?id='+v+'&t=s&stime='+Math.random();
					img[n]= document.createElement("img");
					if (img[n].readyState){  //IE  
						img[n].onreadystatechange = function(){
				            if (img[n].readyState == "loaded"||img[n].readyState == "complete"){  
				                img[n].onreadystatechange = null;  
				                callback(img[n],n);  
				            }else{
				            	window.alert('图片加载失败');
				            }
				        };  
				    } else {  //Others  
				        img[n].onload = function(){  
				            callback(img[n],n);
				        };
				        img[n].onerror = function(){
				            window.alert('图片加载失败');
				        };
 
				    }
					img[n].src = img_url;
					str+='<li class="loading"><a href="dl.php?id='+v+'&t=b"><img src="'+img_url+'"/></a></li>';
				});
				$('#photo_list_ctn ul').html(str);
				var photo_obj=$('#photo_list_ctn li');
				var show_pic=new water_fall(photo_obj);
				$('#photo_list_ctn ul li a').lightBox();
				$('#pagination_ctn a').live('click',function(){
					var obj=$(this);
					if (obj.hasClass('c'))
						return false;
					else{
						$('#pagination_ctn a').removeClass('c');
						obj.addClass('c');
					}
					var p=$('#pagination_ctn a').index(obj)+1;
					show_pic.flip_page(p);
				});
				$(window).scroll(function(){show_pic.init();}).resize(function(){show_pic.init();});
			}else{
				show_info('该图册没有任何图片','notice');
			}
			$(window).resize(set_window);
		},'json');
	}
	//
};
/*
var load=new show_loading();
var img = new Image();
$(img).load(function(){
	load.stop();
	$('#login_bg').hide().css('background','url("dl.php?id=2") center no-repeat').fadeIn();
}).attr("src", 'dl.php?id=2');
*/
--></script>

</body>
</html>